--- title: Capture keywords: fastai sidebar: home_sidebar summary: "Wrapper class and example code for getting images from the OpenHSI using a ximea detetor (with IMX252 sensor, e.g. MX031CG-SY. " description: "Wrapper class and example code for getting images from the OpenHSI using a ximea detetor (with IMX252 sensor, e.g. MX031CG-SY. " nb_path: "01_capture.ipynb" ---
{% raw %}
/Users/eway/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pandas/compat/__init__.py:97: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
  warnings.warn(msg)
100%|██████████| 1024/1024 [00:17<00:00, 59.05it/s]
{% endraw %} {% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class OpenHSI[source]

OpenHSI(n_lines:int=16, processing_lvl:int=2, txt_path:str='assets/cam_settings.txt', pkl_path:str='assets/cam_calibration.pkl') :: DataCube

Base Class for the OpenHSI Camera.

{% endraw %} {% raw %}
{% endraw %}

Running in notebook slow downs.

{% raw %}

OpenHSI.collect[source]

OpenHSI.collect()

Collect the hyperspectral datacube.

{% endraw %} {% raw %}

class SimulatedCamera[source]

SimulatedCamera(img_path:str=None, n_lines:int=16, processing_lvl:int=2, txt_path:str='assets/cam_settings.txt', pkl_path:str='assets/cam_calibration.pkl') :: OpenHSI

Base Class for the OpenHSI Camera.

{% endraw %} {% raw %}
100%|██████████| 1024/1024 [00:16<00:00, 62.55it/s]
{% endraw %} {% raw %}
plt.imshow(cam.rgb_buff.data)
<matplotlib.image.AxesImage at 0x12c404ee0>
{% endraw %} {% raw %}
plt.plot(cam.λs,cam.xs[0],'r',label="X(λ)")
plt.plot(cam.λs,cam.ys[0],'g',label="Y(λ)")
plt.plot(cam.λs,cam.zs[0],'b',label="Z(λ)")
plt.grid(); plt.minorticks_on()
plt.legend()
plt.xlabel("λ (nm)")
plt.ylabel("CIE XYZ value")
Text(0, 0.5, 'CIE XYZ value')
{% endraw %} {% raw %}
plt.plot(cam.binned_wavelengths,cam.dc.data[350,300,:],label="rock")
plt.plot(cam.binned_wavelengths,cam.dc.data[50,300,:], label="sky")
plt.plot(cam.binned_wavelengths,cam.dc.data[150,300,:],label="water")
plt.legend()
plt.xlabel("wavelength (nm)")
plt.ylabel("pseudo-spectra")
Text(0, 0.5, 'pseudo-spectra')
{% endraw %} {% raw %}

delegates.._f[source]

delegates.._f(f)

{% endraw %} {% raw %}
{% endraw %}